package cn.liuyijiao;

public class GitTest {
    public static void main(String[] args) {
        // 测试
        testEncrypt("给我回电1234567890");
    }
    public static String reverseString(String input) {
        return new StringBuilder(input).reverse().toString();
    }
    //写一个加密算法
    //加密算法
    public static String encrypt(String input) {
        StringBuilder encrypted = new StringBuilder();
        for (char c : input.toCharArray()) {
            encrypted.append((char) (c + 3));
        }
        return encrypted.toString();
    }
 //加密算法
    public static String decrypted(String input) {
        StringBuilder decrypted = new StringBuilder();
        for (char c : input.toCharArray()) {
            decrypted.append((char) (c - 3));
        }
        return decrypted.toString();
    }
    //写一个测试用例
    public static void testEncrypt(String input) {
        String encrypted = encrypt(input);
        String decrypted = decrypted(encrypted);
        System.out.println("原始字符串: " + input);
        System.out.println("加密后的字符串: " + encrypted);
        System.out.println("解密后的字符串: " + decrypted);
    }
}
